<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../../../../style.css" type="text/css" media="screen">
<link rel="stylesheet" href="../../../../../print.css" type="text/css" media="print">
<meta content="TestCase,net.digitalprimates.flex2.unit.tests.TestCase,testEnvironment,numChildren,addChild,addChildAt,removeChild,removeChildAt,removeAllChildren,getChildAt,getChildByName,getChildIndex,setChildIndex,setUp,tearDown,runSequence,asyncHandler,assertEquals,assertStrictlyEquals,assertTrue,assertFalse,assertNull,assertNotNull,fail" name="keywords">
<title>net.digitalprimates.flex2.unit.tests.TestCase</title>
</head>
<body>
<script type="text/javascript" language="javascript" src="../../../../../asdoc.js"></script><script type="text/javascript" language="javascript" src="../../../../../cookies.js"></script><script type="text/javascript" language="javascript">
<!--
				asdocTitle = 'TestCase - AS3 FlexTest';
				var baseRef = '../../../../../';
				window.onload = configPage;
			--></script>
<table style="display:none" id="titleTable" cellspacing="0" cellpadding="0" class="titleTable">
<tr>
<td align="left" class="titleTableTitle">Unit and Integration Framework for Actionscript 3 and Flex 2 and 3</td><td align="right" class="titleTableTopNav"><a onclick="loadClassListFrame('../../../../../all-classes.html')" href="../../../../../package-summary.html">All&nbsp;Packages</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../../../../all-classes.html')" href="../../../../../class-summary.html">All&nbsp;Classes</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../../../../index-list.html')" href="../../../../../all-index-A.html">Index</a>&nbsp;|&nbsp;<a href="../../../../../index.html?net/digitalprimates/flex2/unit/tests/TestCase.html&amp;net/digitalprimates/flex2/unit/tests/class-list.html" id="framesLink1">Frames</a><a onclick="parent.location=document.location" href="" style="display:none" id="noFramesLink1">No&nbsp;Frames</a></td><td rowspan="3" align="right" class="titleTableLogo"><img alt="Adobe Logo" title="Adobe Logo" class="logoImage" src="../../../../../images/logo.jpg"></td>
</tr>
<tr class="titleTableRow2">
<td align="left" id="subTitle" class="titleTableSubTitle">Class&nbsp;TestCase</td><td align="right" id="subNav" class="titleTableSubNav"><a href="#propertySummary">Properties</a>&nbsp;| <a href="#methodSummary">Methods</a></td>
</tr>
<tr class="titleTableRow3">
<td colspan="2">&nbsp;</td>
</tr>
</table>
<script type="text/javascript" language="javascript">
<!--
if (!isEclipse() || window.name != ECLIPSE_FRAME_NAME) {titleBar_setSubTitle("Class TestCase"); titleBar_setSubNav(false,true,false,false,false,false,true,false,false,false,false,false,false,false);}
--></script>
<div class="MainContent">
<table cellspacing="0" cellpadding="0" class="classHeaderTable">
<tr>
<td class="classHeaderTableLabel">Package</td><td><a onclick="javascript:loadClassListFrame('class-list.html')" href="package-detail.html">net.digitalprimates.flex2.unit.tests</a></td>
</tr>
<tr>
<td class="classHeaderTableLabel">Class</td><td class="classSignature">public class TestCase</td>
</tr>
<tr>
<td class="classHeaderTableLabel">Inheritance</td><td class="inheritanceList">TestCase <img class="inheritArrow" alt="Inheritance" title="Inheritance" src="../../../../../images/inherit-arrow.gif"> flash.events.EventDispatcher</td>
</tr>
</table>
<p></p> 
  <p>
  The TestCase is the class extended to create your own test cases. </p>
  
  <p>
  A test case is an object with a variety of method beginning with 
  the lower case letters 'test'. The TestCase class ensures that 
  tests are always run in the following order:</p>
  
  <p><code>
  run setup()<br/>
    wait for any outstanding asynchronous events</code></p>
  <p><code>
  run the test method<br/>
    wait for any outstanding asynchronous events</code></p>
  <p><code>
  run tearDown()<br/>
    wait for any outstanding asynchronous events</code></p>
  <p>
  The loop then begins again for the next test method.</p>
  <p></p>
<br>
<hr>
</div>
<a name="propertySummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Properties</div>
<table id="summaryTableProperty" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Property</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#numChildren">numChildren</a> : int<div class="summaryTableDescription">[read-only]
       Number of child components in the TestEnvironment.</div>
</td><td class="summaryTableOwnerCol">TestCase</td>
</tr>
</table>
</div>
<a name="protectedPropertySummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Protected Properties</div>
<table id="summaryTableProtectedProperty" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Property</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#testEnvironment">testEnvironment</a> : <a href="../ui/TestEnvironment.html">TestEnvironment</a>
<div class="summaryTableDescription"> 
   Provides a reference to the TestEnvironment.</div>
</td><td class="summaryTableOwnerCol">TestCase</td>
</tr>
</table>
</div>
<a name="methodSummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Methods</div>
<table id="summaryTableMethod" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Method</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#TestCase()">TestCase</a>()</div>
<div class="summaryTableDescription">
        Constructor.</div>
</td><td class="summaryTableOwnerCol">TestCase</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#addChild()">addChild</a>(child:DisplayObject):DisplayObject</div>
<div class="summaryTableDescription">
       Adds a child DisplayObject to the TestEnvironment.</div>
</td><td class="summaryTableOwnerCol">TestCase</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#addChildAt()">addChildAt</a>(child:DisplayObject, index:int):DisplayObject</div>
<div class="summaryTableDescription">
       Adds a child DisplayObject to the TestEnvironment.</div>
</td><td class="summaryTableOwnerCol">TestCase</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#getChildAt()">getChildAt</a>(index:int):DisplayObject</div>
<div class="summaryTableDescription">
       Gets the <i>n</i>th child component object.</div>
</td><td class="summaryTableOwnerCol">TestCase</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#getChildByName()">getChildByName</a>(name:String):DisplayObject</div>
<div class="summaryTableDescription">
       Returns the child whose <code>name</code> property is the specified String.</div>
</td><td class="summaryTableOwnerCol">TestCase</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#getChildIndex()">getChildIndex</a>(child:DisplayObject):int</div>
<div class="summaryTableDescription">
       Gets the zero-based index of a specific child.</div>
</td><td class="summaryTableOwnerCol">TestCase</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#removeAllChildren()">removeAllChildren</a>():void</div>
<div class="summaryTableDescription">
       Removes all children from the child list of this container.</div>
</td><td class="summaryTableOwnerCol">TestCase</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#removeChild()">removeChild</a>(child:DisplayObject):DisplayObject</div>
<div class="summaryTableDescription">
       Removes a child DisplayObject from the child list of the TestEnviroment.</div>
</td><td class="summaryTableOwnerCol">TestCase</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#removeChildAt()">removeChildAt</a>(index:int):DisplayObject</div>
<div class="summaryTableDescription">
       Removes a child DisplayObject from the child list of the TestEnvironment
       at the specified index.</div>
</td><td class="summaryTableOwnerCol">TestCase</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#setChildIndex()">setChildIndex</a>(child:DisplayObject, newIndex:int):void</div>
<div class="summaryTableDescription">
       Sets the index of a particular child.</div>
</td><td class="summaryTableOwnerCol">TestCase</td>
</tr>
</table>
</div>
<a name="protectedMethodSummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Protected Methods</div>
<table id="summaryTableProtectedMethod" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Method</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#assertEquals()">assertEquals</a>(... rest):void</div>
<div class="summaryTableDescription">
   Asserts that the two provided values are equal
   </div>
</td><td class="summaryTableOwnerCol">TestCase</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#assertFalse()">assertFalse</a>(... rest):void</div>
<div class="summaryTableDescription">
   Asserts that the provided argument evaluates to false
   </div>
</td><td class="summaryTableOwnerCol">TestCase</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#assertNotNull()">assertNotNull</a>(... rest):void</div>
<div class="summaryTableDescription">
   Asserts that the provided argument does not evaluate to null
   </div>
</td><td class="summaryTableOwnerCol">TestCase</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#assertNull()">assertNull</a>(... rest):void</div>
<div class="summaryTableDescription">
   Asserts that the provided argument evaluates to null.</div>
</td><td class="summaryTableOwnerCol">TestCase</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#assertStrictlyEquals()">assertStrictlyEquals</a>(... rest):void</div>
<div class="summaryTableDescription">
   Asserts that the provided values are strictly equal.</div>
</td><td class="summaryTableOwnerCol">TestCase</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#assertTrue()">assertTrue</a>(... rest):void</div>
<div class="summaryTableDescription">
   Asserts that the provided argument evaluates to true.</div>
</td><td class="summaryTableOwnerCol">TestCase</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#asyncHandler()">asyncHandler</a>(eventHandler:Function, timeout:int, passThroughData:Object = null, timeoutHandler:Function = null):Function</div>
<div class="summaryTableDescription">
   <p>
   The asyncHandler method is used to create a new AsyncHandler instance, 
   which is a helper object that monitors an object for an event to occur, 
   and allows the test case to resume on its success, or handle the timeout 
   condition, where the specified event does not occur within a provided timeout.</p>
   
   <p>
   The method can be used in the following ways:</p>
   
   <p><code>
   var handler:Function = asyncHandler( handleSomeEvent, 250, null, handleTimeOut );
   someObject.addEventListener( 'someEvent', handler, false, 0, true );
   </code></p>
   OR
   <p>
   combined into a single statment:<br/>
   <code>
   someObject.addEventListener( 'someEvent', asyncHandler( handleSomeEvent, 250, null, handleTimeOut ), false, 0, true );</code></p>
   
   <p>
   The former allows the developer to keep a handler to the created method and therefore
   manually garbage collect it in the future.</div>
</td><td class="summaryTableOwnerCol">TestCase</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#fail()">fail</a>(failMessage:String = ""):void</div>
<div class="summaryTableDescription">
   Immediately causes the test to fail with the message provided.</div>
</td><td class="summaryTableOwnerCol">TestCase</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#runSequence()">runSequence</a>(sequence:Array):void</div>
<div class="summaryTableDescription">
   Used to run a sequence of ISequenceActions and a single ISequenceVerify.</div>
</td><td class="summaryTableOwnerCol">TestCase</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#setUp()">setUp</a>():void</div>
<div class="summaryTableDescription">
   The setup method can be overriden to create test case specific 
   conditions in which each of the test methods run.</div>
</td><td class="summaryTableOwnerCol">TestCase</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#tearDown()">tearDown</a>():void</div>
<div class="summaryTableDescription"> 
   Teardown is used to destroy any items created during setup to rest the test environment
   for the next test.</div>
</td><td class="summaryTableOwnerCol">TestCase</td>
</tr>
</table>
</div>
<script type="text/javascript" language="javascript">
<!--
showHideInherited();
--></script>
<div class="MainContent">
<a name="propertyDetail"></a>
<div class="detailSectionHeader">Property detail</div>
<a name="numChildren"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">numChildren</td><td class="detailHeaderType">property</td>
</tr>
</table>
<div class="detailBody">
<code>numChildren:int</code>&nbsp;&nbsp;[read-only]<p>
       Number of child components in the TestEnvironment.
             </p><p>The number of children is initially equal
       to the number of children declared in MXML.
       At runtime, new children may be added by calling
       <code>addChild()</code> or <code>addChildAt()</code>,
       and existing children may be removed by calling
       <code>removeChild()</code>, <code>removeChildAt()</code>,
       or <code>removeAllChildren()</code>.</p>
      <span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get numChildren():int</code>
<br>
</div>
<a name="testEnvironment"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">testEnvironment</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>protected var testEnvironment:<a href="../ui/TestEnvironment.html">TestEnvironment</a></code><p> 
   Provides a reference to the TestEnvironment. 
   
   A singleton container that exists to allow visual children to be
   created and tested. 
   </p></div>
<a name="constructorDetail"></a>
<div class="detailSectionHeader">Constructor detail</div>
<a name="TestCase()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">TestCase</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">constructor</td>
</tr>
</table>
<div class="detailBody">
<code>public function TestCase()</code><p>
        Constructor.
        </p></div>
<a name="methodDetail"></a>
<div class="detailSectionHeader">Method detail</div>
<a name="addChild()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">addChild</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td>
</tr>
</table>
<div class="detailBody">
<code>public function addChild(child:DisplayObject):DisplayObject</code><p>
       Adds a child DisplayObject to the TestEnvironment.
       The child is added after other existing children,
       so that the first child added has index 0,
       the next has index 1, an so on.
             </p><p><b>Note: </b>While the <code>child</code> argument to the method
       is specified as of type DisplayObject, the argument must implement
       the IUIComponent interface to be added as a child of a container.
       All Flex components implement this interface.</p>
             <span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">child</span>:DisplayObject</code> &mdash; The DisplayObject to add as a child of the TestEnvironment.
       It must implement the IUIComponent interface.
             </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>DisplayObject</code> &mdash; The added child as an object of type DisplayObject. 
       You typically cast the return value to UIComponent, 
       or to the type of the added component.
             </td>
</tr>
</table>
<p>
<span class="label">See also</span>
</p>
<div class="seeAlso">mx.core.Container</div>
</div>
<a name="addChildAt()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">addChildAt</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function addChildAt(child:DisplayObject, index:int):DisplayObject</code><p>
       Adds a child DisplayObject to the TestEnvironment.
       The child is added at the index specified.
             </p><p><b>Note: </b>While the <code>child</code> argument to the method
       is specified as of type DisplayObject, the argument must implement
       the IUIComponent interface to be added as a child of TestEnvironment.
       All Flex components implement this interface.</p>
             <span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">child</span>:DisplayObject</code> &mdash; The DisplayObject to add as a child of the TestEnvironment.
       It must implement the IUIComponent interface.
             </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">index</span>:int</code> &mdash; The index to add the child at.
             </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>DisplayObject</code> &mdash; The added child as an object of type DisplayObject. 
       You typically cast the return value to UIComponent, 
       or to the type of the added component.
             </td>
</tr>
</table>
<p>
<span class="label">See also</span>
</p>
<div class="seeAlso">mx.core.Container</div>
</div>
<a name="assertEquals()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">assertEquals</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>protected function assertEquals(... rest):void</code><p>
   Asserts that the two provided values are equal
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code>... <span class="label">rest</span></code></td>
</tr>
</table>
</div>
<a name="assertFalse()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">assertFalse</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>protected function assertFalse(... rest):void</code><p>
   Asserts that the provided argument evaluates to false
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code>... <span class="label">rest</span></code></td>
</tr>
</table>
</div>
<a name="assertNotNull()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">assertNotNull</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>protected function assertNotNull(... rest):void</code><p>
   Asserts that the provided argument does not evaluate to null
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code>... <span class="label">rest</span></code></td>
</tr>
</table>
</div>
<a name="assertNull()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">assertNull</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>protected function assertNull(... rest):void</code><p>
   Asserts that the provided argument evaluates to null.
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code>... <span class="label">rest</span></code></td>
</tr>
</table>
</div>
<a name="assertStrictlyEquals()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">assertStrictlyEquals</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>protected function assertStrictlyEquals(... rest):void</code><p>
   Asserts that the provided values are strictly equal.
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code>... <span class="label">rest</span></code></td>
</tr>
</table>
</div>
<a name="assertTrue()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">assertTrue</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>protected function assertTrue(... rest):void</code><p>
   Asserts that the provided argument evaluates to true.
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code>... <span class="label">rest</span></code></td>
</tr>
</table>
</div>
<a name="asyncHandler()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">asyncHandler</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>protected function asyncHandler(eventHandler:Function, timeout:int, passThroughData:Object = null, timeoutHandler:Function = null):Function</code><p>
   </p><p>
   The asyncHandler method is used to create a new AsyncHandler instance, 
   which is a helper object that monitors an object for an event to occur, 
   and allows the test case to resume on its success, or handle the timeout 
   condition, where the specified event does not occur within a provided timeout.</p>
   
   <p>
   The method can be used in the following ways:</p>
   
   <p><code>
   var handler:Function = asyncHandler( handleSomeEvent, 250, null, handleTimeOut );
   someObject.addEventListener( 'someEvent', handler, false, 0, true );
   </code></p>
   OR
   <p>
   combined into a single statment:<br/>
   <code>
   someObject.addEventListener( 'someEvent', asyncHandler( handleSomeEvent, 250, null, handleTimeOut ), false, 0, true );</code></p>
   
   <p>
   The former allows the developer to keep a handler to the created method and therefore
   manually garbage collect it in the future. If you choose not to keep a reference to
   the created object, you will need to set the weaklistener object to true in the 
   addEventListener method or your handlers and potentially setup objects may 
   not be garbage collected.</p>
   
   <span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">eventHandler</span>:Function</code> &mdash;    A reference to the event handler that should be called if the event named in the TestCase.asyncHandler() 
    method fires before the timeout is reached. The handler is expected to have the follow signature:
    <p><code>
    public function handleEvent( event:Event, passThroughData:Object ):void {
    }</code></p>
   
   <p>
   The first parameter is the original event object.
   The second parameter is a generic object that can optionally be provided by the developer when starting
   a new asynchronous operation.
   
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">timeout</span>:int</code> &mdash;    The number of milliseconds to wait for the event declared in the addEventListener method to occur before
    determining that this mehtod has timed-out.
   
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">passThroughData</span>:Object</code> (default = <code>null</code>)<code></code> &mdash;    A generic object that is optionally provided by the developer when starting a new asynchronous operation.
    This generic object is passed to the eventHandler function if it is called.
   
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">timeoutHandler</span>:Function</code> (default = <code>null</code>)<code></code> &mdash;    A reference to the event handler that should be called if the event named in the addEventListener 
    method does not fire before the timeout is reached. The handler is expected to have the follow signature:
    <p><code>
    public function handleTimeoutEvent( passThroughData:Object ):void {
    }</code></p>
    <p>
    The parameter is a generic object that will receive any data provided to the passThroughData parameter of this method.</p>
   </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>Function</code></td>
</tr>
</table>
</div>
<a name="fail()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">fail</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>protected function fail(failMessage:String = ""):void</code><p>
   Immediately causes the test to fail with the message provided.
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">failMessage</span>:String</code> (default = "<code></code>")<code></code></td>
</tr>
</table>
</div>
<a name="getChildAt()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">getChildAt</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function getChildAt(index:int):DisplayObject</code><p>
       Gets the <i>n</i>th child component object.
             </p><p>The children returned from this method include children that are
       declared in MXML and children that are added using the
       <code>addChild()</code> or <code>addChildAt()</code> method.</p>
             <span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">index</span>:int</code> &mdash; Number from 0 to (numChildren - 1).
             </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>DisplayObject</code> &mdash; Reference to the child as an object of type DisplayObject. 
       You typically cast the return value to UIComponent, 
       or to the type of a specific Flex control, such as ComboBox or TextArea.
      </td>
</tr>
</table>
</div>
<a name="getChildByName()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">getChildByName</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function getChildByName(name:String):DisplayObject</code><p>
       Returns the child whose <code>name</code> property is the specified String.
             </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">name</span>:String</code> &mdash; The identifier of the child.
             </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>DisplayObject</code> &mdash; The DisplayObject representing the child as an object of type DisplayObject.
       You typically cast the return value to UIComponent, 
       or to the type of a specific Flex control, such as ComboBox or TextArea.
      </td>
</tr>
</table>
</div>
<a name="getChildIndex()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">getChildIndex</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function getChildIndex(child:DisplayObject):int</code><p>
       Gets the zero-based index of a specific child.
             </p><p>The first child of the Test Environment (i.e.: the first child tag
       that appears in the MXML declaration) has an index of 0,
       the second child has an index of 1, and so on.
       The indexes of the test environemnt children determine
       the order in which they get laid out.
       For example, in a VBox the child with index 0 is at the top,
       the child with index 1 is below it, etc.</p>
             <p>If you add a child by calling the <code>addChild()</code> method,
       the new child's index is equal to the largest index among existing
       children plus one.
       You can insert a child at a specified index by using the
       <code>addChildAt()</code> method; in that case the indices of the
       child previously at that index, and the children at higher indices,
       all have their index increased by 1 so that all indices fall in the
       range from 0 to <code>(numChildren - 1)</code>.</p>
             <p>If you remove a child by calling <code>removeChild()</code>
       or <code>removeChildAt()</code> method, then the indices of the
       remaining children are adjusted so that all indices fall in the
       range from 0 to <code>(numChildren - 1)</code>.</p>
             <p>If <code>myView.getChildIndex(myChild)</code> returns 5,
       then <code>myView.getChildAt(5)</code> returns myChild.</p>
             <p>The index of a child may be changed by calling the
       <code>setChildIndex()</code> method.</p>
             <span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">child</span>:DisplayObject</code> &mdash; Reference to child whose index to get.
             </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>int</code> &mdash; Number between 0 and (numChildren - 1).
      </td>
</tr>
</table>
</div>
<a name="removeAllChildren()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">removeAllChildren</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function removeAllChildren():void</code><p>
       Removes all children from the child list of this container.
      </p></div>
<a name="removeChild()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">removeChild</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function removeChild(child:DisplayObject):DisplayObject</code><p>
       Removes a child DisplayObject from the child list of the TestEnviroment.
       The removed child will have its <code>parent</code>
       property set to null. 
       The child will still exist unless explicitly destroyed.
       If you add it to another container,
       it will retain its last known state.
             </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">child</span>:DisplayObject</code> &mdash; The DisplayObject to remove.
             </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>DisplayObject</code> &mdash; The removed child as an object of type DisplayObject. 
       You typically cast the return value to UIComponent, 
       or to the type of the removed component.
      </td>
</tr>
</table>
</div>
<a name="removeChildAt()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">removeChildAt</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function removeChildAt(index:int):DisplayObject</code><p>
       Removes a child DisplayObject from the child list of the TestEnvironment
       at the specified index.
       The removed child will have its <code>parent</code>
       property set to null. 
       The child will still exist unless explicitly destroyed.
       If you add it to another container,
       it will retain its last known state.
             </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">index</span>:int</code> &mdash; The child index of the DisplayObject to remove.
             </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>DisplayObject</code> &mdash; The removed child as an object of type DisplayObject. 
       You typically cast the return value to UIComponent, 
       or to the type of the removed component.
      </td>
</tr>
</table>
</div>
<a name="runSequence()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">runSequence</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>protected function runSequence(sequence:Array):void</code><p>
   Used to run a sequence of ISequenceActions and a single ISequenceVerify. 
   
   The test does not fail or pass until the sequence completes or fails on 
   one of the steps of the sequence. 
   
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">sequence</span>:Array</code> &mdash; An array of ISequenceActions and an ISequenceVerify. 
   </td>
</tr>
</table>
</div>
<a name="setChildIndex()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">setChildIndex</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function setChildIndex(child:DisplayObject, newIndex:int):void</code><p>
       Sets the index of a particular child.
       See the <code>getChildIndex()</code> method for a
       description of the child's index.
             </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">child</span>:DisplayObject</code> &mdash; Reference to child whose index to set.
             </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">newIndex</span>:int</code> &mdash; Number that indicates the new index.
       Must be an integer between 0 and (numChildren - 1).
      </td>
</tr>
</table>
</div>
<a name="setUp()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">setUp</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>protected function setUp():void</code><p>
   The setup method can be overriden to create test case specific 
   conditions in which each of the test methods run.
   
   For each test in a TestCase, the following procedure is followed:
   
   run setup()
     wait for any outstanding asynchronous events
   run the test method
     wait for any outstanding asynchronous events
   run tearDown()
     wait for any outstanding asynchronous events
   
   The loop then begins again for the next test method.
   </p></div>
<a name="tearDown()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">tearDown</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>protected function tearDown():void</code><p> 
   Teardown is used to destroy any items created during setup to rest the test environment
   for the next test.
   
   For example, if a Timer is created during the setUp() method, the reference to that
   Timer must be set as null in the teardown to ensure it is recreated the next time
   setUp() is run.
   
   The teardown method needs to be overriden whenever the setup method is overriden.
   </p></div>
<br>
<br>
<hr>
<br>
<p></p>
<center class="copyright">Copyright 2007 Digital Primates IT Consulting Group</center>
</div>
</body>
</html>
<!--Copyright 2007 Digital Primates IT Consulting Group-->
